import json

card_map = {
    "A": 14,
    "K": 13,
    "Q": 12,
    "J": 11,
    "T": 10,
    "9": 9,
    "8": 8,
    "7": 7,
    "6": 6,
    "5": 5,
    "4": 4,
    "3": 3,
    "2": 2,
}

strong_kicker = {
    'A',
    'K',
    'Q',
    'J',
}

middle_kicker = {
    'T',
    '9',
    '8',
    '7',
}

weak_kicker = {
    '6',
    '5',
    '4',
    '3',
    '2',
}


def get_board_card_num(board):
    s = {board[0], board[2], board[4]}
    return len(s)


def get_board_suit_num(board):
    s = {board[1], board[3], board[5]}
    return len(s)


def get_board_hand_card_num(board, hand):
    s = {board[0], board[2], board[4], hand[0], hand[2]}
    return len(s)


def get_board_hand_card_detail(board, hand):
    detail = {}
    for i in range(0, 3):
        if board[i * 2] in detail:
            detail[board[i * 2]] += 1
        else:
            detail[board[i * 2]] = 1
    for i in range(0, 2):
        if hand[i * 2] in detail:
            detail[hand[i * 2]] += 1
        else:
            detail[hand[i * 2]] = 1
    return detail


def get_board_hand_suit_num(board, hand):
    s = {board[1], board[3], board[5], hand[1], hand[3]}
    return len(s)


def get_board_hand_suit_detail(board, hand):
    detail = {}
    for i in range(0, 3):
        if board[i * 2 + 1] in detail:
            detail[board[i * 2 + 1]] += 1
        else:
            detail[board[i * 2 + 1]] = 1
    for i in range(0, 2):
        if hand[i * 2 + 1] in detail:
            detail[hand[i * 2 + 1]] += 1
        else:
            detail[hand[i * 2 + 1]] = 1
    return detail


def check_board_rainbow(board):
    return get_board_suit_num(board) == 3


def check_board_unpair(board):
    return get_board_card_num(board) == 3


def check_board_pair(board):
    return get_board_card_num(board) == 2


def check_board_trips(board):
    return board[0] == board[2] == board[3]


def check_is_royal_flush_straight(board, hand):
    return ((board[0] == 'A' or hand[0] == 'A') and (board[4] == 'T' or hand[2] == 'T')) and check_is_flush_straight(
        board, hand)


def check_is_flush_straight(board, hand):
    return check_is_flush(board, hand) and check_is_straight(board, hand)


def check_is_quards(board, hand):
    detail = get_board_hand_card_detail(board, hand)
    if len(detail) != 2:
        return False
    for value in detail.values():
        if value == 4:
            return True
    return False


def check_is_full_house(board, hand):
    detail = get_board_hand_card_detail(board, hand)
    if len(detail) != 2:
        return False
    for value in detail.values():
        if value == 3 or value == 2:
            return True
    return False


def check_is_flush(board, hand):
    return board[1] == board[3] == board[5] == hand[1] == hand[3]


def check_is_nut_flush(board, hand):
    if check_is_flush(board, hand):
        set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        i = 14
        for index in range(14, 2, -1):
            if index not in set_card:
                i = index
                break
        return card_map[hand[0]] > i
    return False


def check_is_second_flush(board, hand):
    if check_is_flush(board, hand):
        set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        i = 14
        for index in range(14, 2, -1):
            if index not in set_card:
                i = index
                break
        j = i - 1
        for index in range(i - 1, 2, -1):
            if index not in set_card:
                j = index
                break
        return i > card_map[hand[0]] > j
    return False


def check_is_straight(board, hand):
    straight_card = set()
    if board[0] != 'A' and hand[0] != 'A':
        set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 4:
            return False
    else:
        set_card = {1, card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 5:
            return False
    for i in range(0, card_num - 4):
        if array_card[i + 4] - array_card[i] == 4:
            return True
    return False


def check_is_nut_straight(board, hand):
    if check_is_straight(board, hand):
        if board[0] == 'A':
            return True
        if card_map[board[0]] - card_map[board[4]] == 4:
            return True
        elif card_map[board[0]] - card_map[board[4]] == 3:
            return card_map[hand[0]] == card_map[board[0]] + 1
        else:
            max_card = card_map[hand[0]] + 2 if card_map[hand[0]] + 2 <= 14 else 14
            return max_card == card_map[hand[0]]
    return False


def check_is_bottom_straight(board, hand):
    if check_is_straight(board, hand):
        if board[0] == 'A':
            return False
        if card_map[board[0]] - card_map[board[4]] == 4:
            return False
        elif card_map[board[0]] - card_map[board[4]] == 3:
            if hand[0] == 'A':
                return card_map[board[0]] <= 5
            return card_map[board[4]] > card_map[hand[2]]
        else:
            if hand[0] == 'A':
                return card_map[board[0]] <= 5
            return card_map[hand[0]] < card_map[board[4]]
    return False


def check_is_set(board, hand):
    if not check_board_unpair(board):
        return False
    if hand[0] != hand[2]:
        return False
    return board[0] == hand[0] or board[2] == hand[0] or board[4] == hand[0]


def check_is_top_set(board, hand):
    if not check_board_unpair(board):
        return False
    return board[0] == hand[0] == hand[2]


def check_is_middle_set(board, hand):
    if not check_board_unpair(board):
        return False
    return board[2] == hand[0] == hand[2]


def check_is_bottom_set(board, hand):
    if not check_board_unpair(board):
        return False
    return board[4] == hand[0] == hand[2]


def check_is_trips(board, hand):
    if not check_board_pair(board) or hand[0] == hand[2]:
        return False
    detail = get_board_hand_card_detail(board, hand)
    if len(detail) != 3:
        return False
    for value in detail.values():
        if value == 3:
            return True
    return False


def check_is_two_pair(board, hand):
    if not check_board_unpair(board) or hand[0] == hand[2]:
        return False
    return get_board_hand_card_num(board, hand) == 3


def check_is_top_two_pair(board, hand):
    if not check_board_unpair(board) or hand[0] == hand[2]:
        return False
    return board[0] == hand[0] and board[2] == hand[2]


def check_is_middle_two_pair(board, hand):
    if not check_board_unpair(board) or hand[0] == hand[2]:
        return False
    return board[0] == hand[0] and board[4] == hand[2]


def check_is_bottom_two_pair(board, hand):
    if not check_board_unpair(board) or hand[0] == hand[2]:
        return False
    return board[2] == hand[0] and board[4] == hand[2]


def check_is_over_pair(board, hand):
    if hand[0] != hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4 or board_card_num == 3:
        return card_map[hand[0]] > card_map[board[0]]
    return False


def check_is_over_pair_aa(board, hand):
    return hand[0] == 'A' and check_is_over_pair(board, hand)


def check_is_over_pair_kk(board, hand):
    return hand[0] == 'K' and check_is_over_pair(board, hand)


def check_is_top_pair(board, hand):
    if hand[0] == hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4:
        return board[0] == hand[0] or board[0] == hand[2]
    elif board_card_num == 3:
        if check_board_pair(board) and board[0] != board[2]:
            return board[0] == hand[0] or board[0] == hand[2]
    return False


def check_is_top_pair_top_kick(board, hand):
    if not check_is_top_pair(board, hand):
        return False
    hand_pair = hand[0] if board[0] == hand[0] else hand[2]
    hand_not_pair = hand[0] if board[0] == hand[2] else hand[2]
    set_card = {hand_pair, board[0], board[2], board[4]}
    if 'A' not in set_card:
        return hand_not_pair == 'A'
    if 'K' not in set_card:
        return hand_not_pair == 'K'
    if 'Q' not in set_card:
        return hand_not_pair == 'Q'
    return hand_not_pair == 'J'


def check_is_top_pair_strong_kick(board, hand):
    if not check_is_top_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[0] == hand[2] else hand[2]
    return hand_not_pair in strong_kicker


def check_is_top_pair_middle_kick(board, hand):
    if not check_is_top_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[0] == hand[2] else hand[2]
    return hand_not_pair in middle_kicker


def check_is_top_pair_weak_kick(board, hand):
    if not check_is_top_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[0] == hand[2] else hand[2]
    return hand_not_pair in weak_kicker


def check_is_pair_between_top_and_middle(board, hand):
    if hand[0] != hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4:
        return card_map[board[0]] > card_map[hand[0]] > card_map[board[2]]
    elif board_card_num == 3:
        return card_map[board[0]] > card_map[hand[0]] > card_map[board[4]]
    return False


def check_is_middle_pair(board, hand):
    if hand[0] == hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4:
        return board[2] == hand[0] or board[2] == hand[2]
    elif board_card_num == 3:
        if check_board_pair(board) and board[0] == board[2]:
            return board[4] == hand[0] or board[4] == hand[2]
    return False


def check_is_middle_pair_top_kicker(board, hand):
    if not check_is_middle_pair(board, hand):
        return False
    hand_pair = hand[0] if board[2] == hand[0] else hand[2]
    hand_not_pair = hand[0] if board[2] == hand[2] else hand[2]
    set_card = {hand_pair, board[0], board[2], board[4]}
    if 'A' not in set_card:
        return hand_not_pair == 'A'
    if 'K' not in set_card:
        return hand_not_pair == 'K'
    if 'Q' not in set_card:
        return hand_not_pair == 'Q'
    return hand_not_pair == 'J'


def check_is_middle_pair_strong_kick(board, hand):
    if not check_is_middle_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[2] == hand[2] else hand[2]
    return hand_not_pair in strong_kicker


def check_is_middle_pair_middle_kick(board, hand):
    if not check_is_middle_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[2] == hand[2] else hand[2]
    return hand_not_pair in middle_kicker


def check_is_middle_pair_weak_kick(board, hand):
    if not check_is_middle_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[2] == hand[2] else hand[2]
    return hand_not_pair in weak_kicker


def check_is_pair_between_middle_and_bottom(board, hand):
    if hand[0] != hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4:
        return card_map[board[2]] > card_map[hand[0]] > card_map[board[4]]
    return False


def check_is_bottom_pair(board, hand):
    if hand[0] == hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4:
        return board[4] == hand[0] or board[4] == hand[2]
    return False


def check_is_bottom_pair_top_kicker(board, hand):
    if not check_is_bottom_pair(board, hand):
        return False
    hand_pair = hand[0] if board[4] == hand[0] else hand[2]
    hand_not_pair = hand[0] if board[4] == hand[2] else hand[2]
    set_card = {hand_pair, board[0], board[2], board[4]}
    if 'A' not in set_card:
        return hand_not_pair == 'A'
    if 'K' not in set_card:
        return hand_not_pair == 'K'
    if 'Q' not in set_card:
        return hand_not_pair == 'Q'
    return hand_not_pair == 'J'


def check_is_bottom_pair_strong_kick(board, hand):
    if not check_is_bottom_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[4] == hand[2] else hand[2]
    return hand_not_pair in strong_kicker


def check_is_bottom_pair_middle_kick(board, hand):
    if not check_is_bottom_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[4] == hand[2] else hand[2]
    return hand_not_pair in middle_kicker


def check_is_bottom_pair_weak_kick(board, hand):
    if not check_is_bottom_pair(board, hand):
        return False
    hand_not_pair = hand[0] if board[4] == hand[2] else hand[2]
    return hand_not_pair in weak_kicker


def check_is_weak_pair(board, hand):
    if hand[0] != hand[2]:
        return False
    board_card_num = get_board_hand_card_num(board, hand)
    if board_card_num == 4 or board_card_num == 3:
        return card_map[hand[0]] < card_map[board[4]]
    return False


def check_is_a_high(board, hand):
    if hand[0] != 'A' or board[0] == 'A' or hand[0] == hand[2]:
        return False
    suit_num = get_board_hand_suit_num(board, hand)
    if suit_num == 1:
        return False
    card_num = get_board_hand_card_num(board, hand)
    if card_num != 5:
        return False
    return not check_is_straight(board, hand)


def check_is_k_high(board, hand):
    if hand[0] != 'K' or board[0] == 'A' or board[0] == 'K' or hand[0] == hand[2]:
        return False
    suit_num = get_board_hand_suit_num(board, hand)
    if suit_num == 1:
        return False
    card_num = get_board_hand_card_num(board, hand)
    if card_num != 5:
        return False
    return not check_is_straight(board, hand)


def check_is_flush_draw(board, hand):
    suit_num = get_board_hand_suit_num(board, hand)
    if suit_num != 2:
        return False
    detail = get_board_hand_suit_detail(board, hand)
    for value in detail.values():
        if value == 4:
            return True
    return False


def check_is_oesd(board, hand):
    straight_card = set()
    if board[0] != 'A' and hand[0] != 'A':
        set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 3:
            return False
    else:
        set_card = {1, card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 4:
            return False

    for i in range(0, card_num - 4):
        if array_card[i + 4] - array_card[i] == 4:
            return False

    for i in range(0, card_num - 3):
        if array_card[i + 3] - array_card[i] == 3:
            if array_card[i + 3] != 14 and array_card[i] != 1:
                return True
        if array_card[i + 3] - array_card[i] == 4:
            for j in range(i, i + 3):
                if array_card[j + 1] - array_card[j] == 2:
                    straight_card.add(array_card[j] + 1)
    return len(straight_card) == 2


def check_is_over_card(board, hand):
    if card_map[hand[2]] < card_map[board[0]] or hand[0] == hand[2]:
        return False
    suit_num = get_board_hand_suit_num(board, hand)
    if suit_num == 1:
        return False
    card_num = get_board_hand_card_num(board, hand)
    if card_num != 5:
        return False
    return not check_is_straight(board, hand)


def check_is_gut_shot(board, hand):
    straight_card = set()
    if board[0] != 'A' and hand[0] != 'A':
        set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 3:
            return False
    else:
        set_card = {1, card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]], card_map[hand[2]]}
        array_card = list(set_card)
        array_card.sort()
        card_num = len(set_card)
        if card_num <= 4:
            return False

    for i in range(0, card_num - 4):
        if array_card[i + 4] - array_card[i] == 4:
            return False

    for i in range(0, card_num - 3):
        if array_card[i + 3] - array_card[i] == 3:
            if array_card[i + 3] != 14 and array_card[i] != 1:
                return False
            else:
                return True
        if array_card[i + 3] - array_card[i] == 4:
            for j in range(i, i + 3):
                if array_card[j + 1] - array_card[j] == 2:
                    straight_card.add(array_card[j] + 1)
    return len(straight_card) == 1


def check_is_top_gut_shot(board, hand):
    if check_is_gut_shot(board, hand):
        if board[0] != 'A' and hand[0] != 'A':
            set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]],
                        card_map[hand[2]]}
            card_num = len(set_card)
            array_card = list(set_card)
            array_card.sort()
        else:
            set_card = {1, card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]],
                        card_map[hand[2]]}
            card_num = len(set_card)
            array_card = list(set_card)
            array_card.sort()
        for i in range(0, card_num - 3):
            if array_card[i + 3] - array_card[i] == 3:
                if array_card[i + 3] == 14:
                    return hand[0] == 'A'
            if array_card[i + 3] - array_card[i] == 4:
                if array_card[i + 3] == 14:
                    return hand[0] == 'A'
                if array_card[i] == 1:
                    return False
                else:
                    if hand[0] == hand[2]:
                        return card_map[hand[0]] == array_card[i + 3]
                    else:
                        set_card2 = {array_card[i], array_card[i + 1], array_card[i + 2], array_card[i + 3]}
                        array_card2 = list(set_card2)
                        array_card2.sort()
                        if card_map[hand[0]] in set_card2 and card_map[hand[2]] in set_card2:
                            return array_card2[2] == card_map[hand[2]] and array_card2[3] == card_map[hand[0]]
                        elif card_map[hand[0]] in set_card2:
                            return array_card2[3] == card_map[hand[0]]
                        else:
                            return array_card2[3] == card_map[hand[2]]
        return False
    return False


def check_is_bottom_gut_shot(board, hand):
    if check_is_gut_shot(board, hand):
        if board[0] != 'A' and hand[0] != 'A':
            set_card = {card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]],
                        card_map[hand[2]]}
            card_num = len(set_card)
            array_card = list(set_card)
            array_card.sort()
        else:
            set_card = {1, card_map[board[0]], card_map[board[2]], card_map[board[4]], card_map[hand[0]],
                        card_map[hand[2]]}
            card_num = len(set_card)
            array_card = list(set_card)
            array_card.sort()
        for i in range(0, card_num - 3):
            if array_card[i + 3] - array_card[i] == 3:
                if array_card[i] == 1:
                    return hand[0] == 'A'
            if array_card[i + 3] - array_card[i] == 4:
                if array_card[i] == 1:
                    return hand[0] == 'A'
                if array_card[i + 3] == 14:
                    return False
                else:
                    if hand[0] == hand[2]:
                        return card_map[hand[0]] == array_card[i]
                    else:
                        set_card2 = {array_card[i], array_card[i + 1], array_card[i + 2], array_card[i + 3]}
                        array_card2 = list(set_card2)
                        array_card2.sort()
                        if card_map[hand[0]] in set_card2 and card_map[hand[2]] in set_card2:
                            return array_card2[0] == card_map[hand[2]] and array_card2[1] == card_map[hand[0]]
                        elif card_map[hand[0]] in set_card2:
                            return array_card2[0] == card_map[hand[0]]
                        else:
                            return array_card2[0] == card_map[hand[2]]
        return False
    return False


def check_is_backdoor_flush(board, hand):
    suit_num = get_board_suit_num(board)
    if suit_num == 1:
        return False
    detail = get_board_hand_suit_detail(board, hand)
    for value in detail.values():
        if value == 3:
            return True
    return False


def generate_hand_desc(board, hand):
    hand_make = {}
    hand_draw = {}
    ret = {}
    if check_is_quards(board, hand):
        hand_make['quards'] = 1
    elif check_is_full_house(board, hand):
        hand_make['full_house'] = 1
    elif check_is_flush(board, hand):
        hand_make['flush'] = 1
        if check_is_nut_flush(board, hand):
            hand_make['nut_flush'] = 1
        elif check_is_second_flush(board, hand):
            hand_make['second_flush'] = 1
        if check_is_flush_straight(board, hand):
            hand_make['flush_straight'] = 1
            hand_make['straight'] = 1
            if check_is_royal_flush_straight(board, hand):
                hand_make['royal_flush_straight'] = 1
    elif check_is_straight(board, hand):
        hand_make['straight'] = 1
        if check_is_nut_straight(board, hand):
            hand_make['nut_straight'] = 1
        elif check_is_bottom_straight(board, hand):
            hand_make['b_straight'] = 1
    elif check_is_set(board, hand):
        hand_make['set'] = 1
        if check_is_top_set(board, hand):
            hand_make['t_set'] = 1
        elif check_is_middle_set(board, hand):
            hand_make['m_set'] = 1
        elif check_is_bottom_set(board, hand):
            hand_make['b_set'] = 1
    elif check_is_trips(board, hand):
        hand_make['trips'] = 1
    elif check_is_two_pair(board, hand):
        hand_make['two_pair'] = 1
        if check_is_top_two_pair(board, hand):
            hand_make['t_two_pair'] = 1
        elif check_is_middle_two_pair(board, hand):
            hand_make['m_two_pair'] = 1
        elif check_is_bottom_two_pair(board, hand):
            hand_make['b_two_pair'] = 1
    elif check_is_over_pair(board, hand):
        hand_make['o_pair'] = 1
        if check_is_over_pair_aa(board, hand):
            hand_make['o_pair_aa'] = 1
        elif check_is_over_pair_kk(board, hand):
            hand_make['o_pair_kk'] = 1
    elif check_is_top_pair(board, hand):
        hand_make['t_pair'] = 1
        if check_is_top_pair_top_kick(board, hand):
            hand_make['t_pair_tk'] = 1
        if check_is_top_pair_strong_kick(board, hand):
            hand_make['t_pair_sk'] = 1
        elif check_is_top_pair_middle_kick(board, hand):
            hand_make['t_pair_mk'] = 1
        elif check_is_top_pair_weak_kick(board, hand):
            hand_make['t_pair_wk'] = 1
    elif check_is_pair_between_top_and_middle(board, hand):
        hand_make['t2m_pair'] = 1
    elif check_is_middle_pair(board, hand):
        hand_make['m_pair'] = 1
        if check_is_middle_pair_top_kicker(board, hand):
            hand_make['m_pair_tk'] = 1
        if check_is_middle_pair_strong_kick(board, hand):
            hand_make['m_pair_sk'] = 1
        elif check_is_middle_pair_middle_kick(board, hand):
            hand_make['m_pair_mk'] = 1
        elif check_is_middle_pair_weak_kick(board, hand):
            hand_make['m_pair_wk'] = 1
    elif check_is_pair_between_middle_and_bottom(board, hand):
        hand_make['m2b_pair'] = 1
    elif check_is_bottom_pair(board, hand):
        hand_make['b_pair'] = 1
        if check_is_bottom_pair_top_kicker(board, hand):
            hand_make['b_pair_tk'] = 1
        if check_is_bottom_pair_strong_kick(board, hand):
            hand_make['b_pair_sk'] = 1
        elif check_is_bottom_pair_middle_kick(board, hand):
            hand_make['b_pair_mk'] = 1
        elif check_is_bottom_pair_weak_kick(board, hand):
            hand_make['b_pair_wk'] = 1
    elif check_is_weak_pair(board, hand):
        hand_make['w_pair'] = 1
    elif check_is_a_high(board, hand):
        hand_make['a_high'] = 1
    elif check_is_k_high(board, hand):
        hand_make['k_high'] = 1
    if len(hand_make) > 0:
        ret['make'] = hand_make

    if check_is_flush_draw(board, hand):
        hand_draw['flush_d'] = 1
    elif check_is_backdoor_flush(board, hand):
        hand_draw['bd_flush'] = 1
    if check_is_over_card(board, hand):
        hand_draw['over_card'] = 1
    if check_is_oesd(board, hand):
        hand_draw['oesd'] = 1
    elif check_is_gut_shot(board, hand):
        hand_draw['gut_shot'] = 1
        if check_is_top_gut_shot(board, hand):
            hand_draw['t_gut_shot'] = 1
        elif check_is_bottom_gut_shot(board, hand):
            hand_draw['b_gut_shot'] = 1
    if len(hand_draw) > 0:
        ret['draw'] = hand_draw
    return ret
